generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model Users {
  id                Int            @id @default(autoincrement())
  name              String
  user_photos       Photos[]
  user_achievements Achievements[]
}

model Photos {
  id          Int    @id @default(autoincrement())
  description String
  url_image   String
  latitude    Int
  longitude   Int
  city        String
  Users       Users? @relation(fields: [usersId], references: [id])
  usersId     Int?
}

model Achievements {
  id            Int            @id @default(autoincrement())
  name          String
  description   String
  usersId       Int?
  Users         Users?         @relation(fields: [usersId], references: [id])
  achievementPhotoId Int?
  achievementPhoto AchievementPhoto? @relation(fields: [achievementPhotoId], references: [id])
}

model AchievementPhoto {
  id        Int      @id @default(autoincrement())
  url_image String   @unique
  achievements Achievements[]
}
